package cn.wsalix.weixin.req.entity;

import javax.persistence.Entity;
import javax.persistence.EntityListeners;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.Table;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import com.thoughtworks.xstream.annotations.XStreamAlias;
import com.thoughtworks.xstream.annotations.XStreamConverter;

import cn.wsalix.weixin.message.req.ReqType;
import cn.wsalix.weixin.util.XStreamCDataConverter;

@Entity
@DynamicInsert
@DynamicUpdate
@Table(name = "WX_REQ_MES_TEXT")
@Inheritance(strategy = InheritanceType.JOINED)
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
@EntityListeners({ AuditingEntityListener.class })
@XStreamAlias("xml")
public final class TextReqMsg extends BaseReqMsg {

    /**
	 * 
	 */
	private static final long serialVersionUID = 1328255980680418774L;
	@XStreamAlias("Content")
	@XStreamConverter(value = XStreamCDataConverter.class)
	private String content;

    public TextReqMsg() {
        super();
        setMsgType(ReqType.TEXT);
    }

    public void setContent(String content) {
		this.content = content;
	}

	public String getContent() {
        return content;
    }

}
